#include "AiDialog.h"
#include <string>

using namespace std;

AiDialog::AiDialog(QWidget *parent) : QScrollArea(parent)
{
    // 禁止父窗口颜色影响子窗口颜色
    this->setAttribute(Qt::WA_StyledBackground);
    this->setFrameShape(QFrame::NoFrame);
    this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    this->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);

    // 滚动条样式重定义-隐藏AiDialog
    string verticalbar_qss = R"(
		QScrollBar{width:16px;background:rgb(255, 255, 255);margin:0px, 0px, 0px, 0px;}
		QScrollBar::handle:vertical{width:10px;background:rgba(162, 163, 165, 50%);border-radius:4px;min-height:40;}
              QScrollBar::handle:vertical:hover{width:10px;background:rgba(115,118,118, 50%);border-radius:4px;min-height:40;}
              QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical{background:rgb(255, 255, 255);border-radius:4px;}
              QScrollBar::top-arrow:vertical,QScrollBar::bottom-arrow:vertical{border: none;background: none;color: none;}
              QScrollBar::add-line:vertical{border:none;background:none;}
              QScrollBar::sub-line:vertical{border:none;background:none;})";

    this->verticalScrollBar()->setStyleSheet(QString::fromStdString(verticalbar_qss));

    // 自身样式
    this->setStyleSheet("background-color: rgb(255, 255, 255);border:none;");
}

// 析构
AiDialog::~AiDialog(){

}
